import java.util.Scanner;

public class Demo_3_8_6 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String answer = "y";//input.next();
        double sum = 0, sum1 = 0, chance;
        while (answer.equals("y")) {
            System.out.println("请选择购买商品的编号：\n1.T恤\t2.网球拍\t3.网球鞋");
            int chosen = input.nextInt();
            switch (chosen) {
                case 1: {
                    System.out.println("请输入购买数量：");
                    int num = input.nextInt();
                    sum1 = 245 * num;
                    System.out.println("T恤￥245.0\t购买数量：" + num + "合计：￥" + sum1);

                }
                break;
                case 2: {
                    System.out.println("请输入购买数量：");
                    int num = input.nextInt();
                    sum1 = 145.0 * num;
                    System.out.println("T网球拍￥145.0\t购买数量：" + num + "合计：￥" + sum1);

                }
                break;
                case 3: {
                    System.out.println("请输入购买数量：");
                    int num = input.nextInt();
                    sum1 = 345.0 * num;
                    System.out.println("T网球鞋￥145.0\t购买数量：" + num + "合计：￥" + sum1);
                }
                break;
            }
            sum += sum1;
            System.out.println("是否继续？");
            answer = input.next();
        }
        System.out.println("折扣：0.8");
        System.out.println("应付金额：￥" + sum * 0.8);
        System.out.println("实付金额：" );
        int money = input.nextInt();
        chance = money - sum * 0.8;
        System.out.println("找钱：" + chance);
        System.out.println("程序结束");
    }
}
